//
//  DXChannelLabel.swift
//  nineteenfloor
//
//  Created by 大郗 on 16/3/6.
//  Copyright © 2016年 大郗. All rights reserved.
//

import UIKit

class DXChannelLabel: UILabel {
    
//    var scale:CGFloat?
    
    override init(frame: CGRect) {
        super.init(frame: frame)
        self.textAlignment = .Center
        self.font = UIFont.systemFontOfSize(20)
//        self.scale = 0
    }

    required init?(coder aDecoder: NSCoder) {
        super.init(coder: aDecoder)
    }

    /*
    - (instancetype)initWithFrame:(CGRect)frame{
    if (self=[super initWithFrame:frame]) {
    //文字居中
    self.textAlignment = NSTextAlignmentCenter;
    
    self.font = [UIFont systemFontOfSize:20];
    
    //所有的标签初始化都是0
    self.scale = 0;
    }
    
    return self;
    }
    
    - (void)setScale:(CGFloat)scale{
    _scale = scale;
    
    //1.让颜色变化
    self.textColor = [UIColor colorWithRed:scale green:0 blue:0 alpha:1.0];
    
    CGFloat minScale = 0.8;
    
    /**
    规定你最终是在0.8-1.0之间
    */
    CGFloat lastScale = minScale + (1-minScale)*scale;
    
    //2.让大小变化
    self.transform = CGAffineTransformMakeScale(lastScale, lastScale);
    }
*/
    
}
